package al.ui;

import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;

public class Button extends JPanel {
	
	JPanel content;
	JButton b;
	
	public Button(String labels[], String tool[]) {
		//setLayout(new FlowLayout(FlowLayout.CENTER));
		//setBackground(Color.WHITE);
		content = new JPanel();
		//setLayout (new BoxLayout(content, BoxLayout.X_AXIS));
		content.setLayout(new BoxLayout(content,BoxLayout.X_AXIS));
		for (int i=0; i<labels.length; i++) {
			b = new JButton(new ImageIcon(labels[i]));
			
			//JButton b = new JButton(labels[i]);
			
			content.add(b);
			b.setToolTipText(tool[i]);
			//add(content);
		}
		add(content);
		
	}
	
	public Button(String labels[],String image[],String tool[]){
		content = new JPanel();
		content.setLayout(new BoxLayout(content,BoxLayout.X_AXIS));
		for (int i=0; i<labels.length; i++) {
			JButton b = new JButton(labels[i],new ImageIcon(image[i]));
			content.add(b);
			b.setToolTipText(tool[i]);
		}
		add(content);
		
	}	
	
	public void setAlignment(int align) {
		setLayout(new FlowLayout(align));
	}

}
